﻿<%@ Page Title="" Language="C#" MasterPageFile="~/NPS/app/Survey/survey.master" AutoEventWireup="true"
    CodeFile="InputHasil.aspx.cs" Inherits="NPS_app_Survey_InputHasil" %>

<%@ Register Assembly="eWorld.UI, Version=2.0.1.2222, Culture=neutral, PublicKeyToken=24d65337282035f2"
    Namespace="eWorld.UI" TagPrefix="ew" %>
<asp:Content ID="Content1" ContentPlaceHolderID="Back" runat="server">
    <a class="backbutton" href="../../Default.aspx" data-bind="click: closeApp">
        <img src="../../img/Left.png" />
    </a>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Header" runat="server">
    Form Input Hasil Survey
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="body" runat="server">
    <div id="body">
        <!-- Jquery Core-->
        <script type="text/javascript" src="../../js/jquery182.js"></script>
        <script type="text/javascript" src="../../js/jquery-ui.js"></script>
        <link rel="stylesheet" href="../../css/jquery-ui.css">
        <script type="text/javascript" src="../../js/jquery.jgrowl.js"></script>
        <link rel="stylesheet" href="../../css/jquery.jgrowl.css">
        <style>
            .alpha60
            {
                /* Fallback for web browsers that doesn't support RGBa */
                background: rgb(0, 0, 0) transparent; /* RGBa with 0.6 opacity */
                background: rgba(0, 0, 0, 0.6); /* For IE 5.5 - 7*/
                filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000); /* For IE 8*/
                -ms-filter: "progid:DXImageTransform.Microsoft.gradient(startColorstr=#99000000, endColorstr=#99000000)";
            }
        </style>
        <div class="container metro">
            <form class="metro-form" runat="server" id="SurveyInput">
            <script>

                $(function () {
                    $("#slider").slider({
                        //value: 0,
                        min: 0,
                        max: 10,
                        step: 1,
                        slide: refreshColor, change: refreshColor
                    });
                });

                function refreshColor() {
                    var slider = $("#slider").slider("value");
                    var color = "red";
                    var type = "DETRACTOR";
                    if (slider > 6) { color = "yellow"; type = "PASSIVE"; }
                    if (slider > 8) { color = "green"; type = "PROMOTER"; }
                    $("#slider").css("background", color);
                    $("#slider").css("border-color", color);
                    $("#<%= ltScore.ClientID %>").text(slider.toString());
                    $("#<%= txtType.ClientID %>").val(type.toString());
                    $("#<%= hfScore.ClientID %>").val(slider.toString());
                    $("#<%= hfType.ClientID %>").val(type.toString());
                }

                function CloseDialog() {
                    $("#divPopup").slideToggle();
                    $("#divPopupOverlay").slideToggle();
                }
                $(document).ready(function () {
                    $("#divPopup").hide();
                    $("#divPopupOverlay").hide();

                    $('#openPopup').live('click', function () {
                        $("#divPopup").slideToggle();
                        $("#divPopupOverlay").slideToggle();
                    });
                    $('#closePopup').live('click', function () {
                        $("#divPopup").slideToggle();
                        $("#divPopupOverlay").slideToggle();
                    });
                    $('#divPopupOverlay').live('click', function () {
                        $("#divPopup").slideToggle();
                        $("#divPopupOverlay").slideToggle();
                    });
                });
            </script>
            <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"
                AsyncPostBackTimeout="7200" ScriptMode="Auto">
            </asp:ScriptManager>
            <div id="divPopupOverlay" class="alpha60" style="width: 3000px; height: auto; position: fixed;
                top: 0; bottom: 0; right: 0;">
            </div>
            <div id="divPopup" style="position: absolute; z-index: 99; top: 100px; left: 200px;
                background-color: #2597CB; padding: 20px; border: solid 6px;">
                <asp:UpdatePanel runat="server" ID="up1">
                    <ContentTemplate>
                        <div>
                            <table>
                                <tr>
                                    <td style="width: 90px;">
                                        <label>
                                            Nama</label>
                                    </td>
                                    <td>
                                        <div class="metro-text-box">
                                            <asp:TextBox ID="txtSearchName" runat="server"></asp:TextBox>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <label>
                                            Perusahaan</label>
                                    </td>
                                    <td>
                                        <div style="height: 38px;">
                                            <div class="metro-text-box">
                                                <asp:TextBox ID="txtSearchCompany" runat="server"></asp:TextBox>
                                            </div>
                                            <div style="position: relative; top: -52px; right: -239px;">
                                                <asp:LinkButton runat="server" CssClass="metro-button" ID="btnSearch" Text="Cari"
                                                    OnClick="btnSearch_Click" /></div>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2">
                                        <div class="metro-form" style="width: 800px; font-size: 14px;">
                                            <asp:GridView ID="gvSearch" runat="server" Width="100%" Height="1px" AllowPaging="True"
                                                HeaderStyle-BackColor="#626270" Font-Names="Arial" Font-Size="11pt" RowStyle-VerticalAlign="Top"
                                                AutoGenerateColumns="False" PageSize="10" BorderColor="white" BorderStyle="Solid"
                                                RowStyle-BackColor="#6291B1" AlternatingRowStyle-BackColor="#4FA1DA" BorderWidth="4px"
                                                CellPadding="3" ForeColor="Black" GridLines="Both" 
                                                Style="margin-top: 0em;" ShowFooter="false"
                                                OnRowCommand="gvSearch_RowCommand" 
                                                onpageindexchanging="gvSearch_PageIndexChanging">
                                                <Columns>
                                                    <asp:BoundField HeaderText="Nama" DataField="sxpicname" ItemStyle-Font-Size="11px" />
                                                    <asp:BoundField HeaderText="Perusahaan" DataField="sxcompanyname" ItemStyle-Font-Size="11px" />
                                                    <asp:BoundField HeaderText="Jabatan" DataField="sxposition" ItemStyle-Font-Size="11px" />
                                                    <asp:TemplateField ItemStyle-VerticalAlign="Top" ItemStyle-HorizontalAlign="Center"
                                                        ItemStyle-Width="100px">
                                                        <ItemTemplate>
                                                            <asp:LinkButton Text="Pilih" runat="server" ID="btnChoose" CssClass="metro-button"
                                                                Style="font-size: 11px; margin: 0; padding: 0 10px 0 10px;" CommandName="choose"
                                                                CommandArgument='<%# Eval("iID") %>' />
                                                        </ItemTemplate>
                                                    </asp:TemplateField>
                                                </Columns>
                                                <EmptyDataTemplate>
                                                    No Records Found</EmptyDataTemplate>
                                                <PagerSettings PageButtonCount="5" NextPageText="Next" PreviousPageText="Previous"
                                                    FirstPageText="First" LastPageText="last" Mode="NumericFirstLast" />
                                            </asp:GridView>
                                        </div>
                                    </td>
                                </tr>
                            </table>
                            <div style="position: absolute; top: 9px; right: 11px;">
                                <button class="metro-button" id="closePopup">
                                    Close</button>
                            </div>
                        </div>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </div>
            <asp:UpdatePanel ID="upHeader" runat="server" UpdateMode="Conditional">
                <Triggers>
                    <asp:PostBackTrigger ControlID="gvSearch" />
                </Triggers>
                <ContentTemplate>
                    <asp:Label ID="lblInfo" runat="server"></asp:Label>
                    <div class="metro-form-control" style="width: 300px; height: 68px">
                        <label>
                            Nama Contact Person</label>
                        <div class="metro-text-box">
                            <asp:HiddenField runat="server" ID="hfID" />
                            <asp:TextBox ID="txtName" runat="server" Enabled="false" />
                        </div>
                        <div style="position: relative; right: -336px; top: -53px;">
                            <button class="metro-button" id="openPopup">
                                ...</button></div>
                    </div>
                    <asp:Panel runat="server" ID="pnlInfo2" Visible="false">
                        <div class="metro-form-control" style="width: 300px">
                            <label>
                                Perusahaan</label>
                            <div class="metro-text-box">
                                <asp:TextBox ID="txtPerusahaan" runat="server" Enabled="false"></asp:TextBox>
                            </div>
                        </div>
                        <div class="metro-form-control" style="width: 300px">
                            <label>
                                Kelas</label>
                            <div class="metro-text-box">
                                <asp:TextBox ID="txtKelas" runat="server" Enabled="false"></asp:TextBox>
                            </div>
                        </div>
                        <div class="metro-form-control" style="width: 300px">
                            <label>
                                Segment</label>
                            <div class="metro-text-box">
                                <asp:TextBox ID="txtSegment" runat="server" Enabled="false"></asp:TextBox>
                            </div>
                        </div>
                        <div class="metro-form-control" style="width: 300px">
                            <label>
                                Position</label>
                            <div class="metro-text-box">
                                <asp:TextBox ID="txtPosition" runat="server" Enabled="false"></asp:TextBox>
                            </div>
                        </div>
                    </asp:Panel>
                </ContentTemplate>
            </asp:UpdatePanel>
            <asp:Panel ID="pnlInfo" runat="server" Visible="false">
                <div class="metro-form-control" style="width: 300px">
                    <label>
                        Kategori</label>
                    <div class="metro-text-box">
                        <asp:DropDownList ID="ddlKategori" Width="320px" runat="server" DataValueField="iID"
                            DataTextField="sxTitle">
                        </asp:DropDownList>
                    </div>
                </div>
                <div class="metro-form-control" style="width: 321px">
                    <label>
                        Hasil Survey&nbsp;
                        <asp:Label runat="server" ID="ltScore" Text="0" />
                        <asp:HiddenField runat="server" ID="hfScore" />
                    </label>
                    <div id="slider" />
                </div>
                <div class="metro-form-control" style="width: 300px">
                    <label>
                        Alasan</label>
                    <div class="metro-text-box">
                        <asp:DropDownList ID="ddlReason" Width="320px" runat="server" DataValueField="iID"
                            DataTextField="sxTitle">
                        </asp:DropDownList>
                    </div>
                </div>
                <div class="metro-form-control" style="width: 300px">
                    <label>
                        Tanggal Survey</label>
                    <div class="metro-text-box">
                        <ew:CalendarPopup ID="txtTgl" runat="server" Culture="Indonesian (Indonesia)" DisableTextBoxEntry="False"
                            DisplayPrevNextYearSelection="True" Font-Size="X-Small" PadSingleDigits="True"
                            PopupLocation="Right" ShowGoToToday="True" UpperBoundDate="9999-12-31" Width="80px">
                            <ButtonStyle Font-Size="0" CssClass="metro-button-srch" Height="30px" />
                            <TextBoxLabelStyle Height="16px" />
                        </ew:CalendarPopup>
                    </div>
                </div>
                <div class="metro-form-control" style="width: 300px">
                    <label>
                        Type</label>
                    <div class="metro-text-box">
                        <asp:TextBox ID="txtType" runat="server" Enabled="false" />
                        <asp:HiddenField runat="server" ID="hfType" />
                    </div>
                </div>
                <asp:Button ID="btnSave" OnClick="btnSave_Click" runat="server" CssClass="metro-button"
                    Text="Simpan" />
                &nbsp;
                <asp:Button ID="btnCancel" OnClick="btnCancel_Click" runat="server" CssClass="metro-button"
                    Text="Batal" />
            </asp:Panel>
            <asp:UpdateProgress ID="updateProgress" runat="server">
                <ProgressTemplate>
                    <div style="position: fixed; text-align: center; height: 100%; width: 100%; top: 0;
                        right: 0; left: 0; z-index: 9999999; background-color: #000000; opacity: 0.7;">
                        <span style="border-width: 0px; position: fixed; padding: 50px; background-color: #FFFFFF;
                            font-size: 36px; left: 40%; top: 40%; color: Black;">Please Wait...</span>
                    </div>
                </ProgressTemplate>
            </asp:UpdateProgress>
            </form>
        </div>
    </div>
</asp:Content>
